import { TimeHelper } from "../../../../../Core/Module/Time/TimeHelper";
import { ETTask } from "../../../../../Support/Share/Lib/Async/ETTask";
import { IActorRequest, IActorResponse } from "../../../Share/Module/Actor/IActorMessage";

export class ActorMessageSender {

    private _ActorId: number;
    public get ActorId(): number {
        return this._ActorId;
    }

    // 最近接收或者发送消息的时间
    private _CreateTime: number;
    public get CreateTime(): number {
        return this._CreateTime;
    }

    private _Request: IActorRequest;
    public get Request(): IActorRequest {
        return this._Request;
    }

    private _NeedException: boolean;
    public get NeedException(): boolean {
        return this._NeedException;
    }

    private _Tcs: ETTask<IActorResponse>;
    public get Tcs(): ETTask<IActorResponse> {
        return this._Tcs;
    }

    constructor(actorId: number, iActorRequest: IActorRequest, tcs: ETTask<IActorResponse>, needException: boolean) {
        this._ActorId = actorId;
        this._Request = iActorRequest;
        this._CreateTime = TimeHelper.ServerNow();
        this._Tcs = tcs;
        this._NeedException = needException;
    }

}